<template>
  <el-card class="form-container" shadow="never">
    <el-form
      :model="guide"
      ref="guideFrom"
      label-width="150px"
      size="small">
      <el-form-item label="标题：">
        {{ guide.title }}
      </el-form-item>
      <el-form-item label="发布者：">
        {{ guide.source }}
      </el-form-item>
      <el-form-item label="所属社区：">
        {{ guide.communityName }}
      </el-form-item>
      <el-form-item label="封面：">
        <img style="max-width:300px" :src="guide.image"/>
      </el-form-item>
      <el-form-item
        label="正文："
      >
        <div v-html="guide.content"></div>
      </el-form-item>
      <el-form-item label="渠道：" prop="channel">
        {{ channelTypeOptions[guide.channel] }}
      </el-form-item>

      <el-form-item>
        <!--<el-button type="primary" @click="onSubmit('guideFrom')">提交</el-button>-->
        <!--<el-button v-if="!isEdit" @click="resetForm('courseFrom')">重置</el-button>-->
        <el-button @click="back">返回</el-button>
      </el-form-item>
    </el-form>
  </el-card>
</template>
<script>
import { RcRegistrationContentControllerFindOne } from '@/api/neighbour'

export default {
  name: 'ReviewDetail',
  props: {
    isEdit: {
      type: Boolean,
      default: false
    }
  },
  data () {
    return {
      guide: {},
      channelTypeOptions: {
        '1': 'APP',
        '2': '小程序',
        '3': 'H5'
      },
      loading: false
    }
  },
  mounted () {
    RcRegistrationContentControllerFindOne({ id: this.$route.query.id }).then(response => {
      const { classified, title, source, communityName, image, channel, content } = response.data
      this.guide = {
        classified,
        title,
        source,
        communityName,
        image,
        channel,
        content
      }
    })
  },
  methods: {
    back () {
      this.$router.go(-1)
    }
  }

}
</script>
<style scoped>
  .input-width {
    width: 70%;
  }
  .editor-wrapper{
    position: relative;
    z-index: 2;
  }
</style>
